package com.weactivity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.weactivity.dto.ContactDTO;
import com.weactivity.entity.Contact;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ContactMapper extends BaseMapper<Contact> {


    List<ContactDTO> findAllContact(Long id);

    @Update("update contact set remark= #{remark}  where user_id = #{id} and mate_id = #{mateId}")
    int remark(@Param("id") Long id, @Param("remark") String remark,@Param("mateId") int mateId);

    @Delete("delete from contact where user_id = #{id} AND mate_id = #{mateId}")
    int deleteByMateId(@Param("id") Long id,@Param("mateId") int mateId);
}
